import { BaseCommand, ICmdDialogParams } from '@amcax/base';
import { RJSFSchema } from '@rjsf/utils';
import { Vector3Tuple } from 'three-legacy';
import {
  ICollection,
  IMeshBoundaryLayer,
  IMeshDistribution,
  IMeshSeed,
  IMeshSize,
} from '../document';
import { ENTITY_TYPE } from '../json';

export interface INMCmdDialogParams<T = any> extends ICmdDialogParams {
  params?: T;
}
export interface NMMeshCtrlCmdDialogParams<T = any>
  extends INMCmdDialogParams<T> {
  pickTypes?: ENTITY_TYPE[];
  schema?: RJSFSchema;
  controlType?: 'BoundaryLayer' | 'Distribution' | 'MeshSize';
  isGlobal?: boolean;
  initFormData?: IMeshBoundaryLayer | IMeshDistribution | IMeshSize;
}

type FMeshSeedRequest = (d: IMeshSeed) => Promise<Vector3Tuple[]>;
export interface NMMeshSeedCmdDialogParams<T = any>
  extends INMCmdDialogParams<T> {
  request: FMeshSeedRequest;
}
export interface NMMeshGenCmdDialogParams<T = any>
  extends INMCmdDialogParams<T> {
  type: 'lineMesh' | 'general2D' | 'tetMesh';
  schema?: RJSFSchema;
}
export interface NMCollectionCmdDialogParams<T = any>
  extends INMCmdDialogParams<T> {
  schema: RJSFSchema;
  pickTypes: ENTITY_TYPE[];
  collectionType: 'Node' | 'Element' | 'Surface' | 'ReferPoint';
  initFormData?: ICollection;
}
export interface NMToolCmdDialogParams<T = any> extends INMCmdDialogParams<T> {}
export interface NMTopoCmdDialogParams extends INMCmdDialogParams {}

export interface NMMeshBaseCommand extends BaseCommand {}

export interface NMToolBaseCommand extends BaseCommand {}

export interface NMTopoBaseCommand extends BaseCommand {}
